In semiconductor manufacturing, charged particle beams have been widely used to make high-precision masks. For example, mask makers (or “mask writers”) can use electron beams (“ebeams” or simply “beams”) to transfer design patterns onto masks (referred to as “mask patterns” or “mask shapes”). Software tools have been used to create and optimize the design patterns to fulfill design objectives. The mask patterns are transferred onto a substrate (e.g., a wafer) by a lithography process. The substrate with transferred patterns (referred to as “substrate patterns”) can be treated by following mechanical and chemical processes for manufacturing ICs. The design of the mask can significantly affect the quality of the resulting manufactured ICs. Therefore, it is desirable to produce mask patterns (i.e., an optimized mask) that eliminate (or, at least, significantly reduce) differences between the design patterns and the manufactured ICs. Obtaining an optimized mask is a lengthy process. A need exists for shortening the process of obtaining an optimized mask.